﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using WpfApplication1.Models;
using System.Windows;
using WpfApplication1.Commands;
using Facebook;
using System.Dynamic;
namespace WpfApplication1.ViewModel
{
    class StatusBarViewModel : INotifyPropertyChanged
    {
        static RootData rootData = new RootData();
        static CFacebookServer fbServer = new CFacebookServer(MainWindow.AccessToken);
        StatusModel status = null;
        public string CurrentStatus
        {
            get
            {
                if (status!=null)
                {
                    if(status.Story=="")
                    {
                        return "No New Status";
                    }
                    else
                    {
                        return status.Story;
                    }
                }
                else
                {
                    return "No New Status";
                }
            }
        }
        public StatusBarViewModel(string type, string id, IDictionary<string, object> from, string message,
            string story, IDictionary<string, object> storyTags, string createdTime, string updatedTime, string likeCountText, string commentCountText)
        {
            status = new StatusModel(id, from, message, story, storyTags, createdTime, updatedTime, likeCountText, commentCountText);
        }
        public event PropertyChangedEventHandler PropertyChanged;
        public void OnPropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
